package Servlet;

import jdbc_demo.*;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "MyServlet")
public class DeleteCommitServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //设置响应编码格式
        resp.setContentType("text/html;charset=utf-8");
        //encoding control
        String deleteid= req.getParameter("deletecommitid");
        System.out.println("deleteid---------->"+deleteid);
        if(insertcommit.deletecommit(deleteid)==1)
        {
            System.out.println("deleted over");
        }
        else
        {
            System.out.println("deleted error");
        }

        resp.sendRedirect("UserSpaceServlet");
    }
}
